pload MODELING XDE OCAF
bfuzzyvalue 1e-4

proc traversalWriteStep {shape_list shell} {
	set num 1
	foreach i $shape_list {
		global $i
		XNewDoc D
		XAddShape D $i
		XUpdateAssemblies D
		if {$shell == "top"} {
			WriteStep D topShell_$num.step a
		} else {
			WriteStep D botShell_$num.step a
		}
		unset D
		set num [expr $num +1]
	}
}
if {[info exist shell-top-union]} {
	set top_shape_list [explode shell-top-union]
	traversalWriteStep $top_shape_list top
}
if {[info exist shell-bot-union]} {
	set bot_shape_list [explode shell-bot-union]
	traversalWriteStep $bot_shape_list bottom
}